<html>
	<script type="text/javascript">
		var i = 0;
		function buttonClick(){
			var i = 10;
			func2();
		}

		function func2() {
			alert(i);
		}
	</script>
	<button value="click me" onclick="buttonClick();"/>
</html>